﻿using System.Windows;
using System.Windows.Controls;

namespace ControleRepresentanteSync.View.Setup
{
    /// <summary>
    /// Interaction logic for UserPage.xaml
    /// </summary>
    public partial class UserPage : UserControl
    {
        public UserPage()
        {
            InitializeComponent();
        }

        private void PasswordBoxPasswordChanged(object sender, RoutedEventArgs e)
        {
            ((UserPageViewModel)DataContext).Password = passwordBox.Password;
        }

        private void UserControlDataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            if (DataContext != null)
            {
                passwordBox.Password = ((UserPageViewModel) DataContext).Password;
            }
        }
    }
}
